import { defineStore } from 'pinia'

export const useHomeStore = defineStore('homeStore', {
  state: () => ({
    perms: undefined,
    drawerTitle: undefined,
    drawerComponent: undefined,
    drawerParams: undefined,
    showDrawer: false,
    accessibleBranchIds: undefined
  }),
  actions: {
    openDrawer(component, title, params) {
      this.drawerTitle = title
      this.drawerComponent = component
      this.drawerParams = params
      this.showDrawer = true
    },
    closeDrawer() {
      this.drawerComponent = undefined
      this.showDrawer = false
    }
  }
})
